import { defineComponent, onMounted, ref } from 'vue';
import AudioPlayer from '../main/audioPlayer';
import { AudioOrigin } from '@/main/audioPlayer/type';
import lrcData from './data';

export default defineComponent({
  setup() {
    const audioData = ref<AudioOrigin>({
      resource: {
        name: 'Unit1.mp3', // 资源名称
        url: 'http://oss-test.linpeng.com/D/res/53/o8/6037q/Unit1.mp3' // 资源访问地址
      }
    })
    const lrc = ref<string>('');
    onMounted(() => {
      lrc.value = lrcData;
    })
    return () => (
      <div style={{
        width: '800px',
        height: '600px'
      }}>
        <AudioPlayer
          audio-data={audioData.value}
          lrc={lrc.value}
        />
      </div>
    )
  }
})
